package h0720;

import java.util.Scanner;

public class PasswordCheck {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        s = s.replaceAll(".<", "");
        s = s.replaceAll("<", "");
//        System.out.println(s);
        boolean status=checkPassword(s);
        System.out.println(s+","+status);
    }

    private static boolean checkPassword(String s) {
        if (s.length()<8){
            return false;
        }
        //判断是否至少包含一个大写字母
        String s1=s.replaceAll("[^A-Z]","");
        if (s1.isEmpty()){
            return false;
        }
        //判断是否至少包含一个小写字母
        String s2 = s.replaceAll("[^a-z]", "");
        if (s2.isEmpty()){
            return false;
        }
        String s3=s.replaceAll("[^0-9]","");
        if (s3.isEmpty()){
            return false;
        }
        String s4=s.replaceAll("[a-zA-Z0-9]","");
        if (s4.isEmpty()){
            return false;
        }
        return true;
    }
}
